﻿<%@page import="itsm.isperp.framework.core.context.ContextHolder"%>
<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
  String path = request.getContextPath();
			String basePath = ContextHolder.getWebServerName(request);
%>

<style>
.pass-label {
	display: block;
	float: left;
	height: 42px;
	width: 65px;
	margin-right: 10px;
	line-height: 42px;
	font-size: 14px;
	color: #666;
	font-weight: 700;
}

.pass-input {
	display: block;
	position: relative;
	float: left;
	height: 16px;
	width: 70%;
	padding: 11px 10px;
	margin-right: 10px;
	border: 1px solid #ddd;
	font-size: 14px;
	color: #666;
	transition: .3s;
}

.pass-textarea {
	display: block;
	position: relative;
	float: left;
	width: 80%;
	padding: 11px 10px;
	margin-right: 10px;
	border: 1px solid #ddd;
	font-size: 14px;
	color: #666;
	transition: .3s;
}

.tang-pass-reg .pass-form-item-submit {
	position: relative;
	left: 75px;
}

.pass-button {
	background-color: #3f89ec;
	float: left;
	width:91%;
	border-color: none;
	background-image: none;
	height: 50px;
	-webkit-border-radius: 3px;
	color: #fff;
	cursor: pointer;
	margin-top:4px;
}
.fllogo{
 text-align: center;
 font-size:21px;
 font-family: 'Microsoft Yahei', verdana;
}
</style>
<div style="width:100%;">
	<div class="gBox fr frCon;"
		style="margin:0 auto;min-width: 300px;max-width:600px;padding:0px;">

		<div class="fllogo" style="">
			<span>账号注册</span>
		</div>

		<form id="newIncidentForm" method="post"
			action="help/save">
            <div style="display: none">
				<input type="text" id="id" name="id" value="${model.id }">
			</div>

			<div style="width:100%;">
				<p style="position:relative;clear:both;margin-bottom:20px;zoom:1;">
					<label class="pass-label">姓名</label> <input class="pass-input required" name="fullname" id="fullname" placeholder="默认登陆密码123456，修改请登陆系统后到个人中心修改"/>
				</p>
				<p style="position:relative;clear:both;margin-bottom:20px;zoom:1;">
					<label class="pass-label">手机号码</label> <input class="pass-input required" name="mobile" placeholder="手机号码作为登陆系统的账号" id="mobile"/>
				</p>
				<p style="position:relative;clear:both;margin-bottom:20px;zoom:1;">
					<label class="pass-label">地址</label> <input class="pass-input" name="address" id="address" placeholder="填写联系地址方便到场服务"/>
				</p>
				

				<div id="" class="" style="margin:0 auto;text-align:center;">
					<input id="" type="button" value="提交" onclick="register()"
						style="text-align:center;border:1px solid rgba(0,0,0,.2);border-radius:10px;background-color:#1aad19;background-image:none;font-size:16px;"
						class="pass-button">
				</div>

			</div>

		</form>
	</div>
</div>

<jsp:include page="../customer/help/common/uploader.jsp"></jsp:include>

<script type="text/javascript">
	function register()
	{
	   var name=$("#fullname").val();
	   var mobile=$("#mobile").val();
	   var address=$("#address").val();
	   if(name=="" || mobile=="")
	   {
	      isperp.alert("姓名或手机号码不能为空！"); 
	       return false;
	   }else
	   {
	    var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
	    if(!myreg.test($("#mobile").val())) 
          { 
            isperp.alert("请输入有效的手机号码！");
            return false; 
          } 
	   }
	   $.ajax({
	      url:'help/registerUserEdit',
	      data:{fullname:name,mobile:mobile,address:address},
	      success:function(data)
	      {
	      if(data.success)
	      {
	       isperp.alert("注册成功，账号为<span style='color:red'>手机号码</span>,默认登陆密码为<span style='color:red'>123456</span>，如需修改，请登陆系统后到个人中心修改,点击【确定】返回登陆",{onclick:function(){
	           window.location.href="main/login?name="+mobile;
	        }});
	      }else
	      {
	        isperp.alert(data.msg);
	      }
	        
	      }
	   }); 
	}
</script>




